<template>
	<scroll-view class="scroll-style" scroll-y style="height: calc(100vh - var(--window-bottom));">
		<view class="header-top">
			<image class="logo" src="@/static/image/logo.png"></image>
		</view>
		<view class="content-absolute">
			<view class="user-box">
				<image class="avatar" :src="userInfo.avatar" mode="aspectFill"></image>
				<view class="user-li">
					<text class="nickname">{{userInfo.nickname}}</text>
					<text class="mobile">{{userInfo.mobile}}</text>
				</view>
			</view>
			<view class="content-box">
				<view class="my-list" @click="skip('collect')">
					<view class="my-list-row">
						<image src="@/static/image/wdsc.png" mode="widthFix"></image>
						<text>我的收藏</text>
					</view>
					<image class="right" src="@/static/image/right.png"></image>
				</view>
				<view class="my-list" @click="skip('donate')">
					<view class="my-list-row">
						<image src="@/static/image/wdjz.png" mode="widthFix"></image>
						<text>我的捐赠</text>
					</view>
					<image class="right" src="@/static/image/right.png"></image>
				</view>
				<!-- <view class="my-list">
					<view class="my-list-row">
						<image src="@/static/image/wsjg.png" mode="widthFix"></image>
						<text>我是机构</text>
					</view>
					<image class="right" src="@/static/image/right.png"></image>
				</view> -->
			</view>
		</view>
	</scroll-view>
</template>

<script>
	import { userInfo } from '@/api/my/index'
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		onLoad() {
			this.loadData();
		},
		methods: {
			loadData() {
				userInfo(response => {
					this.userInfo = response;
				})
			},
			
			/* 跳转对应界面 */
			skip(path) {
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.user-box {
		display: flex;
		align-items: center;
		margin: 50rpx 30rpx;
		.avatar {
			width: 115rpx;
			height: 115rpx;
			border-radius: 50%;
		}
		.user-li {
			display: flex;
			flex-direction: column;
			margin-left: 20rpx;
			.nickname {
				color: #fff;
				font-size: 32rpx;
				font-weight: bold;
			}
			.mobile {
				margin-top: 10rpx;
				font-size: 28rpx;
				color: #fff;
			}
		}
	}
	
	.content-box {
		display: flex;
		flex-direction: column;
		width: 100vw;
		min-height: 500rpx;
		border-radius: 40rpx 40rpx 0 0;
		padding: 20rpx 30rpx 30rpx;
		background-color: #fff;
		box-sizing: border-box;
	}
	
	.my-list {
		display: flex;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
		height: 110rpx;
		border-bottom: 1rpx solid #F1F1F1;
		.my-list-row {
			display: flex;
			align-items: center;
			font-size: 28rpx;
			color: #010101;
			image {
				width: 35rpx;
				margin-right: 15rpx;
			}
		}
		.right {
			width: 16rpx;
			height: 30rpx;
		}
	}
</style>